

<div class="box">
	<div class="header">
		Quản lý Groupon
	</div>
	<div class="body">
		<div class="panes">
			<div>
				<a href="<{$APPLICATION_URL}>/Admin/Groupon/add">Tạo mới Groupon</a>
				<table border="0" cellpadding="0" cellspacing="0" class="grid_table wf">
					<thead>
						<tr>
							<th width="10">ID</th>
							<th width="120"></th>
							<th width="120">Tiêu đề</th>
                                                        <th width="300">Mieu Ta</th>
							<th>Nhóm</th>
							<th>Ngày tạo</th>
							<th align="center">Action</th>
						</tr>
					</thead>
					<tbody>
						<{foreach name=pageList item=grouponEntity from=$grouponEntities}>
						<tr>
							<td><{$grouponEntity->id}></td>
							<td><img src="<{$grouponEntity->getImage()}>" width="120"></td>
							<td><{$grouponEntity->title|truncate:50}></td>
							<td><{$grouponEntity->description|truncate:150}></td>
							<td><{$grouponEntity->category_id}></td>
							<td><{$grouponEntity->creation_date}></td>
							<td valign="middle">
								<div style="float: right;">
									 <a class="fancy" href="<{$APPLICATION_URL}>/Admin/Groupon/edit/id/<{$grouponEntity->id}>">
										<img src="<{$APPLICATION_URL}>/Themes/Default/Images/b_edit.png" alt="" />
									</a>
									<!-- <a href="javascript:void(0);" onclick="if (confirm('Are you sure you want to delete this record?')) { deleteAction(<{$grouponEntity->id}>); } else { return false; }" class="notboldText">
										<img src="<{$APPLICATION_URL}>/Themes/Default/Images/b_drop.png" alt="" />
									</a>-->|
                                                                        <a href="<{$APPLICATION_URL}>/Admin/Deals/showdeals/groupon_id/<{$grouponEntity->id}>">Xem các deal</a>
								</div>
							</td>
						</tr>
						<{/foreach}>
					</tbody>
				</table>
			</div>
			
			<div class="paging" style="text-align:center;">
			<{$pageLink}>
			</div>
		</div>
	</div>
</div>
<form name="frmDelete" method="post">
<input type="hidden" name="idValue" value="" />
<input type="hidden" id="actionKey" name="actionKey" value="<{$actionKey}>" />
</form>
<script type="text/javascript">
function deleteAction(value){
	var theform = document.frmDelete;
	theform.idValue.value = value;
	theform.action = "<{$APPLICATION_URL}>/Admin/Groupon/delete";
	theform.submit();
	return true;
}
$(document).ready(function(){
	  $(".fancy").fancybox({
		'scrolling'		: 'no',
		'titleShow'		: true,
		'onClosed'		: function() {
		},
		'onStart' : function(){
		      //load info order
		},
		'onClosed' : function(){
			//window.location.reload();	
		}
	});
		
});
</script>